/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-spi
 * Filename：	SMediaService.java
 * Created：		2016年9月18日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.media;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;

import com.thor.commons.exception.ThorServiceException;
import com.thor.palmmall.rest.common.AAttachment;

/**
 * @author wolv
 *
 */
@Path("/media")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface AMediaService {

  @POST
  @Path("/upload")
  @Consumes("multipart/form-data")
  AAttachment upload(@Multipart(value = "file") Attachment attachment) throws ThorServiceException;

  @POST
  @Path("/upload/list")
  @Consumes("multipart/form-data")
  List<AAttachment> uploadList(List<Attachment> attachments) throws ThorServiceException;

  @GET
  @Path("/fileget/{fileID}")
  String fileget(@PathParam("fileID") String fileID) throws ThorServiceException;;
}
